﻿#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 5001

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["nuget.config", "nuget/"]
COPY ["Coldairarrow.Web/05.Coldairarrow.Web.5x.csproj", "Coldairarrow.Web/"]
COPY ["Coldairarrow.CleanBG/Coldairarrow.CleanBG.csproj", "Coldairarrow.CleanBG/"]
COPY ["Coldairarrow.CleanBG.Base/Coldairarrow.CleanBG.Base.csproj", "Coldairarrow.CleanBG.Base/"]
COPY ["Coldairarrow.Message/Coldairarrow.Message.5x.csproj", "Coldairarrow.Message/"]
COPY ["Coldairarrow.Message.Base/Coldairarrow.Message.Base.5x.csproj", "Coldairarrow.Message.Base/"]
COPY ["Coldairarrow.Quartz/Coldairarrow.Quartz.5x.csproj", "Coldairarrow.Quartz/"]
COPY ["Coldairarrow.Security/Coldairarrow.Security.csproj", "Coldairarrow.Security/"]
COPY ["Coldairarrow.Security.Base/Coldairarrow.Security.Base.csproj", "Coldairarrow.Security.Base/"]
RUN dotnet restore "Coldairarrow.Web/05.Coldairarrow.Web.5x.csproj" --configfile "nuget/nuget.config"

COPY . .
WORKDIR "/src/Coldairarrow.Web"
RUN dotnet build "05.Coldairarrow.Web.5x.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "05.Coldairarrow.Web.5x.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Coldairarrow.Web.dll"]